﻿ALTER TABLE [dbo].[SecurityWindowsGroup_Role_Xref]
	ADD CONSTRAINT [CC_SecurityWindowsGroup_Role_Xref_IncludeChildren] 
	CHECK  (
	(SGX_HierarchyID IS NULL AND SGX_IncludeChildren IS NULL)
	OR
	(SGX_HierarchyID IS NOT NULL AND SGX_IncludeChildren IS NOT NULL)
			)
-- This Constraints Keeps ensures that IncludeChildren is set where ever a Specific HierarchyID is applied.
